package com.my.chapter11;

import java.util.PriorityQueue;
import java.util.Random;

public class practice28 {
    public static void main(String[] args) {
        Random rand= new Random();
        PriorityQueue<Double> priorityQueue = new PriorityQueue<Double>();
        for(int i=0;i<10;i++){
            priorityQueue.offer(rand.nextDouble()*10);
        }
        while(priorityQueue.peek() != null){
            System.out.print(priorityQueue.poll() + " ");
        }
    }
}
